package com.crm.service.system.controller;

import com.crm.model.common.dtos.ResponseResult;
import com.crm.model.system.dtos.LoginDto;
import com.crm.model.system.vos.LoginVo;
import com.crm.service.system.properties.JwtProperties;
import com.crm.service.system.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    /**
     * 生成验证码图片
     * @return
     */
    @GetMapping("/load")
    public ResponseResult<String> load(){
        return loginService.load();
    }

    @PostMapping
    public ResponseResult<LoginVo> login(@RequestBody LoginDto loginDto){
        return loginService.login(loginDto);
    }

}
